package com.bilibili.bilibili.fragment;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.bilibili.bilibili.R;
import com.bilibili.bilibili.adapter.EveryoneSeekListViewAdapter;
import com.bilibili.bilibili.bean.EveryoneSeekBean;

import java.util.List;

/**
 * A simple {@link Fragment} subclass.
 */
public class DramaFragment extends Fragment {


    private View inflate;
    private List<EveryoneSeekBean.DataBean.ItemsBean.ArchiveBean> archive;
    /*List<EveryoneSeekBean.DataBean.ItemsBean.ArchiveBean> list;
    public DramaFragment(List<EveryoneSeekBean.DataBean.ItemsBean.ArchiveBean> list) {
        // Required empty public constructor
        this.list=list;
    }*/


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        inflate = inflater.inflate(R.layout.fragment_drama, container, false);
        if (isAdded()){
            archive = (List<EveryoneSeekBean.DataBean.ItemsBean.ArchiveBean>) getArguments().getSerializable("ARC");

        }
        return inflate;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        ListView listView = (ListView) inflate.findViewById(R.id.fragment_drama_lv);
        listView.setAdapter(new EveryoneSeekListViewAdapter(getActivity(),archive));

    }
}
